<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">

        <el-col :span="8">
          <el-form-item label="报警日期" prop="FBILLCREDATE">
            <el-input v-model="dataForm.FBILLCREDATE"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="教学楼" prop="FPARENTNO">
            <el-input v-model="dataForm.FPARENTNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="场地名称" prop="FPOINT">
            <el-input v-model="dataForm.FPOINT"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="危废桶" prop="FTNAME">
            <el-input v-model="dataForm.FTNAME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="空气项目" prop="FCATNAME">
            <el-input v-model="dataForm.FCATNAME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="报警值" prop="FWARRINGVALUE">
            <el-input v-model="dataForm.FWARRINGVALUE"  disabled />
          </el-form-item>
        </el-col>
        

        <el-col :span="8">
          <el-form-item label="报警单号" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="开始时间" prop="FBEGTIME">
            <el-input v-model="dataForm.FBEGTIME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="结束时间" prop="FENDTIME">
            <el-input v-model="dataForm.FENDTIME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="报警说明" prop="FMEMO">
            <el-input v-model="dataForm.FMEMO"  disabled />
          </el-form-item>
        </el-col>
        
        <el-col :span="5">
          <el-form-item label="">
            <!-- <el-button type="success" icon="el-icon-plus" @click="insert">添加场地</el-button> -->
            <el-button type="primary" :loading="loading">返回</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <el-table :data="list1" border stripe>
       <el-table-column prop="FENTRYID" label="序号" ></el-table-column>
        <el-table-column prop="FWORKNO" label="人员编号" ></el-table-column>
        <el-table-column prop="FWORKNAME" label="人员名称"></el-table-column>
        <el-table-column prop="FMEMO" label="备注信息" ></el-table-column>
    </el-table>

    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        checked1: true,
        checked2  : true,
        activeName: 'first',

        title: "新增",
        insertorupdate: true,
        dataForm: {
            FBILLCREDATE:"2024-12-05",
            FPARENTNO:"第一教学楼",
            FTNAME:"危废化学品盛漏油桶",
            FPOINT:"奉1教楼101",
            FCATNAME:"CO2",
            FWARRINGVALUE:"900",
            FBEGTIME:"11:50:00",
            FENDTIME:"11:52:00",
            FBILLNO:"K241130001",
            FMEMO:"二氧化碳超标"
        },
        rules: {
          FCATNAME:[
            { required: true, message: '请输入空气项目', trigger: 'blur' },
          ],
          FMINVALUE: [
            { required: true, message: '请输入起始值', trigger: 'blur' },
          ],
          FMAXVALUE: [
            { required: true, message: '请输入结束值', trigger: 'blur' },
          ],
        },
        list2: [{  "FENTRYID":1,
                  "FEQUIPNO": "98001",
                  "FEQUIPNAME": "奉3教楼101教室"
                },
                { "FENTRYID":2,
                  "FEQUIPNO": "98002",
                  "FEQUIPNAME": "奉3教楼102教室"
                }],
        list1: [{  "FENTRYID":1,
                    "FWORKNO": "1-1",
                    "FWORKNAME": "秦始皇",
                    "FMEMO": ""
                  },
                  { "FENTRYID":2,
                    "FWORKNO": "1-2",
                    "FWORKNAME": "汉武帝",
                    "FMEMO": ""
                  }],
        
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '室外:PM2.5'
        }, {
          value: '2',
          label: '室外:PM10'
        }, {
          value: '3',
          label: '室内:温度'
        }],

        options2: [{
          value: '1',
          label: '全部'
        }, {
          value: '2',
          label: '教学楼'
        }, {
          value: '3',
          label: '教室'
        }],

        options3: [{
          value: '1',
          label: '未确认'
        }, {
          value: '2',
          label: '已确认'
        }, {
          value: '3',
          label: '已作废'
        }],

        options4: [{
          value: '1',
          label: '低风险'
        }, {
          value: '2',
          label: '中风险'
        }, {
          value: '3',
          label: '高风险'
        }, {
          value: '4',
          label: '重大风险'
        }],
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      //
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>